import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess } from '../_util'
export default [
  {
    url: '/mock-api/device/register',
    method: 'get',
    timeout: 800,
    response: ({ query }) => {
      let res = {
        data: new Array(102).fill({
          'id|+1': 1,
          city: '@city',
          county: '@county',
          org: '单位1',
          lab: '实验室1',
          labLevel: 'p1',
          sn: 'sn',
          fqdn: 'fqdn',
          status: '1',
          ID: 'Id'
        })
      }
      return resultPageSuccess(1,10,res.data)
    }
  },
  {
    url: '/mock-api/device/status',
    method: 'get',
    timeout: 800,
    response: ({ query }) => {
      let res = {
        data: new Array(12).fill({
          'id|+1': 1,
          city: '@city',
          county: '@county',
          org: '单位1',
          lab: '实验室1',
          labLevel: 'p1',
          ID: 'ID',
          CPU: '20%',
          RAM: '60%',
          dataSize: '20GB',
          videoSize: '10GB'
        })
      }
      return resultPageSuccess(1,10,res.data)
    }
  },
  {
    url: '/mock-api/device/remote',
    method: 'get',
    timeout: 800,
    response: ({ query }) => {
      let res = {
        data: new Array(3).fill({
          'id|+1': 1,
          city: '@city',
          county: '@county',
          org: '单位1',
          lab: '实验室1',
          ID: 'ID',
          software: 'XX后台',
          version: '1.0.2',
          updateStatus: 1
        })
      }
      return resultPageSuccess(1,10,res.data)
    }
  },
  {
    url: '/mock-api/device/updatepkg',
    method: 'get',
    timeout: 800,
    response: ({ query }) => {
      let res = {
        data: new Array(5).fill({
          'id|+1': 1,
          registeTime: '@datetime',
          softwareName: 'XX后台',
          version: '1.0.3',
        })
      }
      return resultPageSuccess(1,10,res.data)
    }
  },
  {
    url: '/mock-api/device/update',
    method: 'get',
    timeout: 800,
    response: ({ query }) => {
      let res = {
        data: new Array(5).fill({
          'id|+1': 1,
          city: '@city',
          county: '@county',
          org: '单位3',
          lab: '实验室5',
          ID: 'ID',
          latestUpdateTime: '@datetime',
        })
      }
      return resultPageSuccess(1,10,res.data)
    }
  },
  
] as MockMethod[];
